package com.hzhr.iot.statis.service;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.CygQuery;
import com.hzhr.iot.core.annotation.CygQuerys;
import com.hzhr.iot.core.annotation.CygService;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.core.util.HzhrTypeUtil;
import com.hzhr.iot.statis.convertor.DeviceMonthlyGasConsumeConvertor;
import com.hzhr.iot.statis.dao.DeviceMonthlyGasConsumeDao;
import com.hzhr.iot.statis.dao.mapper.custom.DeviceMonthlyGasConsumeEntityCustomMapper;
import com.hzhr.iot.statis.entity.DeviceMonthlyGasConsumeEntity;
import com.hzhr.iot.statis.entity.ext.DeviceMonthlyGasConsumeEntityExt;
import com.hzhr.iot.statis.model.deviceMonthlyGasConsume.DeviceMonthlyGasConsumeGetModel;
import com.hzhr.iot.statis.model.deviceMonthlyGasConsume.DeviceMonthlyGasConsumeModel;
import com.hzhr.iot.statis.model.deviceMonthlyGasConsume.dataSum.DeviceMonthlyGasConsumeDataSumModel;
import com.hzhr.iot.statis.queryModel.custom.DeviceMonthlyGasConsumeCustomQueryModel;
import com.hzhr.iot.statis.service.base.BaseService;
import com.hzhr.iot.statis.service.helper.User_DeptServiceHelper;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
@CygService(entity = DeviceMonthlyGasConsumeEntity.class, model = DeviceMonthlyGasConsumeModel.class)
@CygQuerys({
        @CygQuery(name = "_equal_collectDeviceId", query = "equal_collectDeviceId", type = Integer.class),
        @CygQuery(name = "_equal_iotDeviceId", query = "equal_iotDeviceId", type = Integer.class),
        @CygQuery(name = "_equal_gasUserId", query = "equal_gasUserId", type = Integer.class),
        @CygQuery(name = "_equal_deptId", query = "equal_deptId", type = Integer.class),
        @CygQuery(name = "_equal_companyId", query = "equal_companyId", type = Integer.class),
        @CygQuery(name = "_greaterthan_date", query = "greaterthan_date", type = Date.class),
        @CygQuery(name = "_greaterthanorequal_date", query = "greaterthanorequal_date", type = Date.class),
        @CygQuery(name = "_lessthan_date", query = "lessthan_date", type = Date.class),
        @CygQuery(name = "_lessthanorequal_date", query = "lessthanorequal_date", type = Date.class),
        @CygQuery(name = "_orderBy_date", query = "orderBy_date", type = String.class),
        @CygQuery(name = "_equal_collectDeviceCategoryCode", query = "equal_collectDeviceExt_categoryCode", type = String.class),
        @CygQuery(name = "_like_collectDeviceResourceCode", query = "like_collectDeviceExt_resourceCode", type = String.class),
        @CygQuery(name = "_greaterthanorequal_collectDeviceInstallTime", query = "greaterthanorequal_collectDeviceExt_installTime", type = Date.class),
        @CygQuery(name = "_lessthan_collectDeviceInstallTime", query = "lessthan_collectDeviceExt_installTime", type = Date.class),
        @CygQuery(name = "_lessthan_data", query = "lessthan_data", type = Double.class),
        @CygQuery(name = "_notin_gasUserCode", query = "notin_collectDeviceExt_gasUserCode", type = List.class),

})
public class DeviceMonthlyGasConsumeService extends BaseService {
    @Autowired
    DeviceMonthlyGasConsumeConvertor deviceMonthlyGasConsumeConvertor;
    @Autowired
    DeviceMonthlyGasConsumeDao deviceMonthlyGasConsumeDao;
    @Autowired
    User_DeptServiceHelper user_deptServiceHelper;
    @Autowired
    DeviceMonthlyGasConsumeEntityCustomMapper deviceMonthlyGasConsumeEntityCustomMapper;

    //region javadoc注释 : get
    /**
     * 查询登录用户管辖范围内的设备的月用气量情况 <br/><br/>
     * 简介&nbsp;:&nbsp;查询登录用户管辖范围内的设备的月用气量情况 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;查询登录用户的所有管辖部门：(√) <br/>
     * &nbsp;使用GLOBAL方式调用部门服务获取用户管辖范围内的所有部门模型对象deptModelList_1， <br/>
     * &nbsp;条件参数如下： <br/>
     * &nbsp;_like_resourceCode&nbsp;=&nbsp;登录用户.userCode&nbsp;+&nbsp;'%'； <br/>
     * &nbsp;然后提取deptModelList_1元素的id属性，得到id属性集合deptIdlist_1； <br/>
     * 2.&nbsp;查询设备的月用气量：(√) <br/>
     * &nbsp;根据条件参数查询设备的月用气量(DEVICE_MONTHLY_GAS_CONSUME)对象集合deviceMonthLyGasConsumeList_1及总数， <br/>
     * &nbsp;额外筛选规则如下： <br/>
     * &nbsp;deviceMonthLyGasConsumeList_1[i].deptId&nbsp;in&nbsp;deptIdlist_1； <br/>
     * 3.&nbsp;返回信息：(√) <br/>
     * &nbsp;根据条件参数和查询到的deptMonthLyGasConsumeList_1及总数生成结果对象并返回； <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _show : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 展示形式 one:展示一个,list:展示列表,null(空值):不展示;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _show_total : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示总数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_info : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示详情;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _is_paging : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否分页;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _page : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 页数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _count : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 每页数量;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_collectDeviceId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.collectDeviceId = #{_equal_collectDeviceId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_iotDeviceId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.iotDeviceId = #{_equal_iotDeviceId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_gasUserId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.gasUserId = #{_equal_gasUserId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_deptId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.deptId = #{_equal_deptId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_companyId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.companyId = #{_equal_companyId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _greaterthan_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.date > #{_greaterthan_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _greaterthanorequal_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.date >= #{_greaterthanorequal_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthan_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.date < #{_lessthan_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthanorequal_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where deviceMonthlyGasConsume.date <= #{_lessthanorequal_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _orderBy_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 排序 : order by deviceMonthlyGasConsume.date #{_orderBy_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/><br/>
     * @throws ServiceException <br/>
     * @see DeviceMonthlyGasConsumeGetModel result <br/>
     */ 
    //endregion
    //region 说明 : get
    //查询登录用户管辖范围内的设备的月用气量情况
    //简介 : 查询登录用户管辖范围内的设备的月用气量情况
    //步骤 :
    //1. 查询登录用户的所有管辖部门：(√)
    // 使用GLOBAL方式调用部门服务获取用户管辖范围内的所有部门模型对象deptModelList_1，
    // 条件参数如下：
    // _like_resourceCode = 登录用户.userCode + '%'；
    // 然后提取deptModelList_1元素的id属性，得到id属性集合deptIdlist_1；
    //2. 查询设备的月用气量：(√)
    // 根据条件参数查询设备的月用气量(DEVICE_MONTHLY_GAS_CONSUME)对象集合deviceMonthLyGasConsumeList_1及总数，
    // 额外筛选规则如下：
    // deviceMonthLyGasConsumeList_1[i].deptId in deptIdlist_1；
    //3. 返回信息：(√)
    // 根据条件参数和查询到的deptMonthLyGasConsumeList_1及总数生成结果对象并返回；
    //endregion
    //region 参数 : get
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_collectDeviceId", value = "筛选条件 : where deviceMonthlyGasConsume.collectDeviceId = #{equal_collectDeviceId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_iotDeviceId", value = "筛选条件 : where deviceMonthlyGasConsume.iotDeviceId = #{equal_iotDeviceId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_gasUserId", value = "筛选条件 : where deviceMonthlyGasConsume.gasUserId = #{equal_gasUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_deptId", value = "筛选条件 : where deviceMonthlyGasConsume.deptId = #{equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_companyId", value = "筛选条件 : where deviceMonthlyGasConsume.companyId = #{equal_companyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "greaterthan_date", value = "筛选条件 : where deviceMonthlyGasConsume.date > #{greaterthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_date", value = "筛选条件 : where deviceMonthlyGasConsume.date >= #{greaterthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_date", value = "筛选条件 : where deviceMonthlyGasConsume.date < #{lessthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthanorequal_date", value = "筛选条件 : where deviceMonthlyGasConsume.date <= #{lessthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "orderBy_date", value = "排序 : order by deviceMonthlyGasConsume.date #{orderBy_date}",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_is_paging", value = "是否分页", defaultValue = "true",required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_collectDeviceId", value = "筛选条件 : where deviceMonthlyGasConsume.collectDeviceId = #{_equal_collectDeviceId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_iotDeviceId", value = "筛选条件 : where deviceMonthlyGasConsume.iotDeviceId = #{_equal_iotDeviceId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_gasUserId", value = "筛选条件 : where deviceMonthlyGasConsume.gasUserId = #{_equal_gasUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_deptId", value = "筛选条件 : where deviceMonthlyGasConsume.deptId = #{_equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_companyId", value = "筛选条件 : where deviceMonthlyGasConsume.companyId = #{_equal_companyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthan_date", value = "筛选条件 : where deviceMonthlyGasConsume.date > #{_greaterthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_date", value = "筛选条件 : where deviceMonthlyGasConsume.date >= #{_greaterthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_date", value = "筛选条件 : where deviceMonthlyGasConsume.date < #{_lessthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthanorequal_date", value = "筛选条件 : where deviceMonthlyGasConsume.date <= #{_lessthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_orderBy_date", value = "排序 : order by deviceMonthlyGasConsume.date #{_orderBy_date}",required = false, dataType = "string", paramType = "query"),

    })
    //endregion
    //region 请求 : get
    @RequestMapping(value = "/device-monthly-gas-consumes", method = RequestMethod.GET)
    //endregion
    public DeviceMonthlyGasConsumeGetModel get(Map<String, String> header, Map<String, Object> query) throws ServiceException {
        /* 查询设备的月用气量 */
        DeviceMonthlyGasConsumeCustomQueryModel queryModel = deviceMonthlyGasConsumeConvertor.deviceMonthlyGasConsumeService_query2queryModel(query);
        List<DeviceMonthlyGasConsumeEntityExt> extList = null;
        String show = HzhrTypeUtil.object2string(query.get("_show"));
        if (!StringUtils.isEmpty(show)) {
            extList = deviceMonthlyGasConsumeDao.selectExtList(queryModel);
        }
        Integer total = null;
        Boolean showTotal = HzhrTypeUtil.object2boolean(query.get("_show_total"));
        if (showTotal != null && showTotal) {
            total = deviceMonthlyGasConsumeDao.selectCount(queryModel);
        }

        /* 返回信息 */
        DeviceMonthlyGasConsumeGetModel result = deviceMonthlyGasConsumeConvertor.extList2deviceMonthlyGasConsumeGetModel(extList, total, null, query);
        return result;
    }

    //region javadoc注释 : getDataSum
    /**
     * 查询设备的月用气量的数据总和 <br/><br/>
     * 简介&nbsp;:&nbsp;查询设备的月用气量的数据总和 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;查询设备的月用气量总和：(√) <br/>
     * 根据条件参数查询DeviceMonthlyGasConsumeModel对象集合的data属性值的总和sum_1； <br/>
     * 2.&nbsp;返回信息：(√) <br/>
     * 创建结果对象result，并设置属性result.dataSum&nbsp;=&nbsp;sum_1； <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _equal_collectDeviceCategoryCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceCategoryCode = #{_equal_collectDeviceCategoryCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _like_collectDeviceResourceCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceResourceCode like #{_like_collectDeviceResourceCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _greaterthanorequal_collectDeviceInstallTime : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime >= #{_greaterthanorequal_collectDeviceInstallTime};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthan_collectDeviceInstallTime : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime < #{_lessthan_collectDeviceInstallTime};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _greaterthan_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.date > #{_greaterthan_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _greaterthanorequal_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.date >= #{_greaterthanorequal_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthan_date : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.date < #{_lessthan_date};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthan_data : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DeviceMonthlyGasConsumeModel.data < #{_lessthan_data};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _notin_gasUserCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where DEVICE_MONTHLY_GAS_CONSUME.DEVICE_COLLECT_DEVICE(关联：COLLECT_DEVICE_ID) not in #{_in_gasUserCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : list;<br/><br/>
     * @throws ServiceException <br/>
     * @see DeviceMonthlyGasConsumeDataSumModel result <br/>
     */ 
    //endregion
    //region 说明 : getDataSum
    //查询设备的月用气量的数据总和
    //简介 : 查询设备的月用气量的数据总和
    //步骤 :
    //1. 查询设备的月用气量总和：(√)
    //根据条件参数查询DeviceMonthlyGasConsumeModel对象集合的data属性值的总和sum_1；
    //2. 返回信息：(√)
    //创建结果对象result，并设置属性result.dataSum = sum_1；
    //endregion
    //region 参数 : getDataSum
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "equal_collectDeviceCategoryCode", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceCategoryCode = #{equal_collectDeviceCategoryCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_collectDeviceResourceCode", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceResourceCode like #{like_collectDeviceResourceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_collectDeviceInstallTime", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime >= #{greaterthanorequal_collectDeviceInstallTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_collectDeviceInstallTime", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime < #{lessthan_collectDeviceInstallTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_date", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.date >= #{greaterthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_date", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.date < #{lessthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_data", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.data < #{lessthan_data}",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_equal_collectDeviceCategoryCode", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceCategoryCode = #{_equal_collectDeviceCategoryCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_collectDeviceResourceCode", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceResourceCode like #{_like_collectDeviceResourceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_collectDeviceInstallTime", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime >= #{_greaterthanorequal_collectDeviceInstallTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_collectDeviceInstallTime", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.collectDeviceInstallTime < #{_lessthan_collectDeviceInstallTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthan_date", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.date > #{_greaterthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_date", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.date >= #{_greaterthanorequal_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_date", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.date < #{_lessthan_date}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_data", value = "筛选条件 : where DeviceMonthlyGasConsumeModel.data < #{_lessthan_data}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_notin_gasUserCode", value = "筛选条件 : where DEVICE_MONTHLY_GAS_CONSUME.DEVICE_COLLECT_DEVICE(关联：COLLECT_DEVICE_ID) not in #{_in_gasUserCode}",required = false, dataType = "list", paramType = "query"),

    })
    //endregion
    //region 请求 : getDataSum
    @RequestMapping(value = "/device-monthly-gas-consumes/data-sum", method = RequestMethod.GET)
    //endregion
    public DeviceMonthlyGasConsumeDataSumModel getDataSum(Map<String, String> header, Map<String, Object> query) throws ServiceException {
        /* 查询设备的日用气量总和 */
        DeviceMonthlyGasConsumeCustomQueryModel queryModel = deviceMonthlyGasConsumeConvertor.deviceMonthlyGasConsumeService_query2queryModel(query);
        Double sum_1 = deviceMonthlyGasConsumeEntityCustomMapper.selectDataSum(queryModel);
        sum_1 = sum_1 == null ? 0.0 : sum_1;

        /* 返回信息 */
        DeviceMonthlyGasConsumeDataSumModel result = new DeviceMonthlyGasConsumeDataSumModel();
        result.setDataSum(sum_1);
        return result;
    }
}





































































































































































































































































































































































































































